//
//  RadioCollectionViewCell.m
//  时光
//
//  Created by dllo on 16/3/23.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "RadioCollectionViewCell.h"

@implementation RadioCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self creatSubview];
    }
    return self;
}

- (void)creatSubview{
    
    self.imageVie = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, 190 * W,  130 * H)];
    [self.contentView addSubview:self.imageVie];
  
    self.labelTitle = [[UILabel alloc] initWithFrame:CGRectMake(10, 140 * H, 190 * W, 30 * H)];
    self.labelTitle.font = [UIFont systemFontOfSize:17 * H weight:0.1];
    self.labelTitle.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview:self.labelTitle];
    
    UIImageView *imageVie2 = [[UIImageView alloc] initWithFrame:CGRectMake(150 * W, 110 * H, 15 * W, 15 * H)];
    imageVie2.image = [UIImage imageNamed:@"iconfont-erji"];
    [self.contentView addSubview:imageVie2];
    
    self.labelplay_count = [[UILabel alloc] initWithFrame:CGRectMake(165 * W, 110 * H, 30 * W, 15 * H)];
    self.labelplay_count.font = [UIFont systemFontOfSize:13 * H];
    self.labelplay_count.textColor = [UIColor blueColor];
    [self.contentView addSubview:self.labelplay_count];
}

-(void)setModel:(RadioModel *)model{
    [self.imageVie sd_setImageWithURL:[NSURL URLWithString:model.playlist_small_image] placeholderImage:[UIImage imageNamed:@"1920329c2e54f271d719def0d6f179fe"]];
    self.labelTitle.text = model.playlist_name;
    
    self.labelplay_count.text = [NSString stringWithFormat:@"%ld", model.play_count];
}


@end
